﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Data;
using System.Drawing;
using System.Configuration;

namespace Presentation.Controls
{
    public partial class imagenzoom : System.Web.UI.UserControl
    {
        public string ImageUrl { get; set; }
        public string ImageTitle { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }
        public bool UseDivOverlay { get; set; }
        public string Rel { get; set; }

        protected override void  OnInit(EventArgs e)
        {
          
        }        

        protected void Page_Load(object sender, EventArgs e)
        {
            if (UseDivOverlay)
                divRedOverlay.Visible = true;

            if (!String.IsNullOrEmpty(Rel))
            {
                ImageLink.Attributes["rel"] = "{" + Rel + "}";
                divRedOverlay.Attributes["rel"] = "{" + Rel + "}";
            }
            ImageLink.Attributes["rel"] = ImageLink.Attributes["rel"] + " lightbox";
            //ImageZoom.ImageUrl = ImageUrl;
            Image.ImageUrl = ImageUrl;
            ImageLink.Attributes["href"] = ImageUrl;
            ImageLink.Attributes["title"] = ImageTitle;
            if (Width != 0)
            {
                Image.Width = Width;
            }
            else
            {
                Image.Width = 90;
            }
            if (Height != 0)
            {
                Image.Height = Height;
            }
            else
            {
                Image.Height = 90;
            }
        }
    }
}